/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "eme_atenciones_lesiones")
@NamedQueries({
    @NamedQuery(name = "EmeAtencionesLesiones.findAll", query = "SELECT e FROM EmeAtencionesLesiones e")})
public class EmeAtencionesLesiones implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "eal_id")
    private Integer ealId;
    @JoinColumn(name = "epc_id", referencedColumnName = "epc_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private EmePartesCuerpo emePartesCuerpo;
    @JoinColumn(name = "els_id", referencedColumnName = "els_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private EmeLesiones emeLesiones;
    @JoinColumn(name = "eat_id", referencedColumnName = "eat_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private EmeAtencion emeAtencion;

    public EmeAtencionesLesiones() {
    }

    public EmeAtencionesLesiones(Integer ealId) {
        this.ealId = ealId;
    }

    public Integer getEalId() {
        return ealId;
    }

    public void setEalId(Integer ealId) {
        this.ealId = ealId;
    }

    public EmePartesCuerpo getEmePartesCuerpo() {
        return emePartesCuerpo;
    }

    public void setEmePartesCuerpo(EmePartesCuerpo emePartesCuerpo) {
        this.emePartesCuerpo = emePartesCuerpo;
    }

    public EmeLesiones getEmeLesiones() {
        return emeLesiones;
    }

    public void setEmeLesiones(EmeLesiones emeLesiones) {
        this.emeLesiones = emeLesiones;
    }

    public EmeAtencion getEmeAtencion() {
        return emeAtencion;
    }

    public void setEmeAtencion(EmeAtencion emeAtencion) {
        this.emeAtencion = emeAtencion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ealId != null ? ealId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EmeAtencionesLesiones)) {
            return false;
        }
        EmeAtencionesLesiones other = (EmeAtencionesLesiones) object;
        if ((this.ealId == null && other.ealId != null) || (this.ealId != null && !this.ealId.equals(other.ealId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.EmeAtencionesLesiones[ ealId=" + ealId + " ]";
    }
    
}
